Skip to content

Comments

Стек и очередь: Сортировочная станция#7

Open
imaxde wants to merge 4 commits intomainfrom
sorting_station
Open

Стек и очередь: Сортировочная станция#7
imaxde wants to merge 4 commits intomainfrom
sorting_station

Conversation

@imaxde
Copy link
Owner

@imaxde imaxde commented Dec 22, 2025

No description provided.

@imaxde imaxde requested a review from WoWaster December 22, 2025 01:50
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Комментарии к самому стеку и про ветки всё те же

return 0;
}

void infixToPostfix(const char* infix, char* postfix)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если уж Вы выделяете память на postfix извне, будьте добры описать, сколько её надо

Comment on lines +37 to +39
while (isdigit(infix[i])) {
postfix[j++] = infix[i++];
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Интересное решение, кажется, даже числа заработают. Хотя просили только цифры

return 0;
}

void infixToPostfix(const char* infix, char* postfix)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется, здесь где-то не хватает обработки небалансных скобок

Comment on lines +23 to +24
int i = 0;
int j = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переменные без внятного названия на верхнем уровне --- плохая идея. Что-нибудь типа prefixIdx и postfixIdx было бы сильно лучше

Comment on lines +25 to +26
int topVal = 0;
int val = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Во-первых, по-моему это должна быть одна переменная. А во-вторвых, лучше переменную объявлять по месту использования. Мало ли что там будет.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants